home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / console / svgatext.3 / svgatext / SVGATextMode-1.3 / doc / PROBLEMS < prev    next >
Encoding:
Text File  |  1995-10-09  |  35.5 KB  |  813 lines

  1. This file describes some possible problems that you could encounter when
  2. using SVGATextMode, and, if any, the suggested solution(s). It also
  3. describes what you should do when you want to report a problem to the
  4. author. 
  5.  
  6. It is rather new, and thus very incomplete. Let's hope it will improve in
  7. the future.
  8.  
  9. Separate chapters will be separated with '========' lines. 
  10.  
  11. Here's a list of subjects covered:
  12.  
  13.  
  14. - General advice when something goes wrong... or even BEFORE it goes wrong
  15.                         READ THIS FIRST!!!! 
  16.  
  17. - Various strange interactions with SVGALIB
  18.  
  19. - Various strange interactions with the XFREE X-server
  20.     - ET4000
  21.     - Switching between X and text mode
  22.     - A special case: Programmable clock chips
  23.     
  24. - Various strange interactions with DOSEMU
  25.  
  26. - Text mode clock limits are mostly LOWER than graphics mode clocks
  27.     - The VGA chip designer at work.
  28.     - How can you see the text mode clock is too high?  
  29.     - "Character bandwidth"
  30.  
  31. - What to do when SVGATextMode produces a Completely Blank Screen
  32.  
  33. - Screen seems to sync up, but completely unreadable
  34.  
  35.  
  36. =============================================================================
  37.  
  38.  
  39. General advice when something goes wrong... or even BEFORE it goes wrong
  40.                         READ THIS FIRST!!!! 
  41. ------------------------------------------------------------------------
  42.  
  43. Before throwing either SVGATextMode or your computer out the window,
  44. consider doing some tests to see what goes wrong.
  45.  
  46. When first trying out SVGATextMode, you might run into a bunch of problems.
  47.  
  48. Some general guidelines for configuring SVGATextMode correctly:
  49.  
  50.  - Make ABSOLUTELY sure the chipset selection is correct. Unlike the XFREE
  51.    X-server program SVGATextMode does NOT check if you actually HAVE the
  52.    chipset you defined in the config file!
  53.    
  54.  - Do NOT enable the Clocks lines in the TextConfig file just like that.
  55.    They are true only for a CERTAIN card using that chipset. You should
  56.    enter the CORRECT clocks, as derived from the X-server with
  57.    
  58.          "X -probeonly"
  59.          
  60.    If you enter the wrong clocks line, all modes above 80x25 will NOT work
  61.    as expected. You've been warned. 
  62.    
  63.  - If you've already configured X-Windows on your system, take a look into
  64.    the XF86Config file. It contains a lot of stuff that can be copied right
  65.    into the TextConfig file!
  66.    
  67.  - To avoid a lot of non-functionning modes, fill in the correct monitor
  68.    limits in the HorizSync and VertRefresh variables. Especially if you have
  69.    a smaller/cheaper/older monitor.
  70.  
  71.  - If all simple methods fail, my BEST advice is to look for ANOTHER monitor
  72.    (rob a store, a friend, or any other innocent victim from his/her monitor
  73.    for a while!), and hook it up to your machine. Now try if the same modes
  74.    that DON'T work on your screen, work on the other screen! Some monitors
  75.    are VERY picky on video timings, and switching monitors is the best way
  76.    to find out if SVGATextMode is wrong, or your monitor...
  77.    
  78.    
  79. And if all these points have been adequately taken care off, the time has
  80. come to do some more extensive tests. 
  81.  
  82. You need to know WHAT exactly is going wrong. Don't send me a mail like
  83. this (this is REAL. Someone really sent me this!) :
  84.  
  85.      Hi,
  86.      
  87.      I've just downloaded the latest version of SVGATextMode, and it doesn't
  88.      work. What should I do? What am I doing wrong?
  89.      
  90.      Any help would be greatly appreciated
  91.      
  92.      Mr X.      (you didn't think I would print his name here, would you?)
  93.      
  94. I'm sorry, but my response (if any!) to that will be a rather angry one.
  95.  
  96. For heaven's sake, how do you think I can help you if you tell me NOTHING.
  97. The example above is really the worst one I ever received, but some come
  98. close.
  99.  
  100. My first advice is: READ THE DOCUMENTATION! I am really trying to put as
  101. much useful information in it as possible, so read it. I never read a lot
  102. of docs myself when I try something new, but if it doesn't work, reading
  103. docs is the thing to do!
  104.  
  105. And secondly: either be prepared to do some solid tests, or throw it away
  106. right now. 
  107.  
  108. The best test to do, is to select a text mode that doesn't work, and then
  109. grab it using "grabmode". If you need to do this blindly ('cause the stupid
  110. piece of &^%#@* makes the screen go nuts), redirect the output to a file,
  111. restore the text mode to a readable one (either through SVGATextMode or a
  112. reboot), and COMPARE THE OUTPUT OF GRABMODE WITH WHAT YOU SELECTED FROM THE
  113. CONFIG FILE.
  114.  
  115. See what's different. In fact, there should be NO BIG DIFFERENCES. If there
  116. are, then you've probably found the cause of your trouble. As in any kind of
  117. problem, locating the cause if half of the solution!
  118.  
  119. The font size and sync polarities reported by grabmode should be EXACTLY the
  120. same as the selected text mode from the config file.
  121.  
  122. The vertical video timings (second group of 4 numbers) should be EXACTLY the
  123. same, except for the first one, which was rounded to the nearest multiple of
  124. the font height when programmed into the VGA chip.
  125.  
  126. The horizontal timings should be close: a maximum difference of 7 is
  127. allowable (these numbers are rounded down to a multiple of 8 before sending
  128. them to the VGA chip).
  129.  
  130. And the pixel clock should at least be close. There are two reasons for a
  131. difference: first of all, when looking for a suitable clock in the clocks
  132. line, SVGATextMode picks the CLOSEST clock, allowing for a 3 MHz difference.
  133. And the second cause is the clock probe, which could, under very bad
  134. conditions, add another  MHz or so to the error. So if the probed clock is
  135. off by 4 or more MHz, then the clock selection code selected the wrong
  136. clock.
  137.  
  138. This can have several causes:
  139.  
  140.   - a bug (but there are none... :-(
  141.   
  142.   - an incorrect clocks line: if it tells SVGATextMode that clock index 7 is
  143.     a 50 MHz clock, and it is IN FACT 80 MHz, don't be surprized if it
  144.     doesn't work. SVGATextMode sopposes the clocks line is reality, and will
  145.     select the clock at index 7 when you select a nmode at 50 MHz.
  146.     with the appropriate testing, you should be able to determine what
  147.     entries in the clocks line are wrong, or what they should be. You could
  148.     even make your own clock probing script by selecting each possible clock
  149.     index, and doing clockprobe on each mode with that clock. That way you could
  150.     eventually create a correct clocks line from it. It's rather cumbersome,
  151.     but it might help. Until I add a real clock probe (as in X).
  152.  
  153.   - If you use an external clock program. through the "clockprog" line, it
  154.     could be the wrong one (=designed for ANOTHER card, with probably
  155.     ANOTHER clock chip one it), or the clock program doesn't interpret the
  156.     arguments given to it correctly, or a million other reasons. Check the
  157.     program WITHOUT SVGATextMode: use the clock probe to see what clock
  158.     you're currently using, and then manually select the SAME clock with
  159.     that external clock program. Nothing should change, since you replace the
  160.     current clock with the same one. As long as this doesn't work, don't
  161.     bother trying it in SVGATextMode.
  162.       e.g.:
  163.           command: ./clockprobe
  164.           result: ./clockprobe: Estimated vertical scanrate = 70.07 Hz.
  165.                   ./clockprobe: Estimated horizontal scanrate = 31.547 kHz.
  166.                   ./clockprobe: Estimated pixel clock = 28.387 MHz.
  167.                   
  168.       so the clock is 28.3 MHz. try:
  169.           <your_cloc_program> 28.3      (if it takes MHz as arguments).
  170.           
  171.       if nothing changes, it COULD work. Now try this from your other text
  172.       modes also (especially the 132x... modes, since they use another
  173.       clock: 40 or 45 MHz)
  174.   
  175.   - If you use a clockchip line, make sure it is the correct one (it should
  176.     be the same one you use in X). If you're in doubt, try some of them, but
  177.     prepare for some reboots!
  178.     
  179.   - The clock selection mechanism of your VGA chip simply isn't supported. 
  180.     If the docs of SVGATextMode say it SHOULD be supported, try reading some
  181.     more docs, they might give you some ideas.
  182.     
  183.   - If you're using an ET4000, watch that hibit_... option ! (it's in the
  184.     docs).
  185.     
  186.   - ?
  187.       
  188.  
  189. Example: 
  190.  
  191.   TextConfig mode:
  192.   "B132x48" 75 1056 1088 1240 1336 768 775 776 800 +hsync +vsync font 8x16
  193.                            
  194.   grabmode report: 
  195.   "132x48" 75.165  1056 1088 1240 1336  768 775 776 800  +Hsync +Vsync font 8x16
  196.                >>   # 56.261kHz/70.33Hz
  197.                
  198. When you see this, you know the card is configured properly. All numbers are
  199. roughly the same.
  200.  
  201. If your monitor doesn't show an image, maybe it cannot cope with the scan
  202. rates this mode uses: SVGATextMode tells you those when loading the mode,
  203. and grabmode adds them as a comment at the end of the mode line. If you have
  204. no idea what I'm talking about: READ THE "monitor-timings.howto" FILE! 
  205.  
  206. If grabmode would e.g. report a 25 or 28 MHz clock in the example above (or
  207. 40/45 MHz when started from a 132x... mode), SVGATextMode probably didn't
  208. change the clock at all. See above for some possibe causes. If any other
  209. number comes out, 
  210.  
  211.  
  212. When all this doesn't help you, you could try looking INSIDE SVGATextMode,
  213. to see what it does to select your text mode. That's why the "-d" option was
  214. added: it shows all steps and their results as SVGATextMode goes through the
  215. process of parsing the TextConfig file, and finally selecting your mode. It
  216. wasn't made to be easy-reading prose, but rather to contain as much as
  217. possible information on the internals of SVGATextMode. Try patiently
  218. browsing through the output, and maybe you'll find the reason for your
  219. problems.
  220.  
  221. And if, after trying all this an more of your own ideas, you are still stuck
  222. with a problem, THEN you can try asking the author. But make sure to add all
  223. relevant information:
  224.  
  225.    - version of SVGATextMode used.
  226.    - the part of the TextConfig file you enabled for your card (clocks,
  227.      clockprog, clockchip, options, ...). Don't send the entire TextConfig,
  228.      I know what it looks like ;-)
  229.    - If you have tried configuring X before, add the relevant part of your
  230.      Xconfig (or XF86Config for XFREE 3.x), and comment on the behaviour of
  231.      X: what worked, and what didn't. 
  232.    - your Linux kernel version number.
  233.    - the type of VGA card!!!! (some forget this, can you imagine?)
  234.      brand, chipset, memory, bus, ... any related or non-related problems
  235.      you had with it, ...
  236.      Mention your VGA card type in EVERY mail to me. This saves me a lot of
  237.      mail-backtracking to find out what you're talking about!
  238.    - which text modes worked, and which didn't. Also add the results from
  239.      grabmode on each mode you mention (especially if that mode doesn't
  240.      work).
  241.    - If you suspect that SVGATextMode doesn't interpret the TextConfig
  242.      correctly, prove it with the output from "SVGATextMode -d" (or part of
  243.      it; don't send the output of SVGATextMode -d for EVERY text mode in the
  244.      Config file. Just show your point with maybe a few modes).
  245.    - any other information you consider relevant (like your sister's age ;-).
  246.      
  247. I know not everyone can understand the black magic of video cards, monitor
  248. timings, and kisses that turn frogs into princes, but reading some
  249. documentation, and using common sense can help a lot.
  250.  
  251. =============================================================================
  252.  
  253.   
  254.  
  255. Various strange interactions with SVGALIB
  256. -----------------------------------------
  257.  
  258. Yes, this is a major problem. Depending on the type of card you have,
  259. Svgalib can do sereral things wrong. In most cases, svgalib is the real
  260. culprit (because SVGATextMode does SO VERY LITTLE compared to SVGAlib).
  261.  
  262. The most common problemn is SVGAlib starting up with the wrong pixel clock
  263. programmed. The result is a non-syncing monitor, or the display divided into
  264. 4 parts with each part showing the same original screen, or a very flickery
  265. screen, or anything else a monitor can come up with...
  266.  
  267. If you suspect this is the case, you can check the clock used by that SVGAlib
  268. mode using the clockprobe. When the screen does not sync, you can do that
  269. from a remote terminal, or if you don't have one, start it with a delay:
  270.  
  271.     (sleep 5 ; ./clockprobe > probe.out) &
  272.  
  273. and then quickly start your SVGAlib application. After you get back to a
  274. readable text mode, check the probe.out file to see what happened. 
  275.  
  276. I am of course unable to do much testing on this, since I don't own any
  277. VGA card with those problems (just luck, I guess).
  278.  
  279. But the only real possibility would be that SVGAlib doesn't reprogram ALL
  280. necessary registers to get to that specific graphics mode, and leaves some
  281. of them untouched. The most obvious ones are the clock programming
  282. registers/bits. And in that case, SVGAlib needs to be adapted to reprogram
  283. ALL clock selection bits.
  284.  
  285. Since SVGATextMode uses approximately the same clock selection method as the
  286. XFREE server (and will come closer and closer to it in the future), it is
  287. likely that you encounter the same problem when using SVGAlib together with
  288. X (e.g. switching from SVGAlib to X and vice versa).
  289.  
  290. Wouldn't the future be much brighter if SVGAlib, XFREE and SVGATextMode used
  291. the SAME VGA programming library, so they cooperate instead of fight?
  292.  
  293. At least ET4000's and Trident cards have been known to show this problem.
  294.  
  295.  
  296. ET4000:
  297. -------
  298.  
  299. [ the following little theory MIGHT be wrong, but I didn't want to spend too
  300.   much time browsing through the SVGAlib source code. I'm a little lazy :-(
  301.   Many SVGATextMode users reported a similar phenomenon, and provided enough
  302.   feedback to justify this. It seems to be mainly an ET4000 problem ]
  303.  
  304.  
  305. SVGAlib has two different sets of modes: the standard VGA modes, and the chipset
  306. specific ones. The most common standard mode is 320x200x256. Others,
  307. commonly known as "VGA tweaked modes" are also available.
  308.  
  309. The standard modes use the standard clock selection machanism used in all
  310. VGA cards: programming the clock to 25 or 28 MHz. ANd they DON'T program any
  311. chipset-specific clock registers.
  312.  
  313. In order to use the ET4000 with SVGAlib, the authors included a program to
  314. run from DOS, that gets you all the necessary data to complete the svgalib
  315. config file. All the modes extracted in that way DO use all ET4000 clock
  316. registers. In addition to the ones grabbed from DOS, SVGAlib also adds a
  317. few "standard" modes of its own, independent of the chip set.
  318.  
  319. The problem creeps up when you run SVGAlib from an extended (non-standard)
  320. SVGATextMode mode, with a non-standard clock (not 25 or 28 MHz). SVGATextMode
  321. has changed the ET4000 extended clock selection bits to get the special
  322. (mostly higher) clock needed for that text mode. But when you select a
  323. standard SVGAlib mode (like 320x200x256), it only changes the standard clock
  324. bits, and leaves the extended ones as they were. 
  325.  
  326. The result is obvious: you get a different pixel clock than was intended.
  327. Many ET4000 cards will run at 50 MHz when in fact they had to run at 25 MHz
  328. for that graphics mode (you can test that with the clockprobe). A real
  329. problem for all those DOOM fans around!
  330.  
  331. When using a non-standard graphics mode (which came from the BIOS, using
  332. that special program for example), the problem does not show, since then ALL
  333. clock selection bits are programmed.
  334.  
  335.  
  336. =============================================================================
  337.  
  338.  
  339.  
  340. Various strange interactions with the XFREE X-server
  341. ----------------------------------------------------
  342.  
  343. ET4000:
  344.  
  345. Most problems are caused by a missing "hibit_..." option in the TextConfig
  346. file or the XF86Config file or both. The option must be present in both
  347. files, and must be the same in BOTH files, otherwise either one might not
  348. work properly, especially when switching vt's.
  349.  
  350. -------
  351.  
  352. Switching between X and text mode:
  353.  
  354. Take heed when switching back to textmodes from X! The XFREE server samples
  355. all SVGA registers for their text mode contents BEFORE moving on to graphics
  356. mode. IT NEVER SAMPLES THEM AGAIN, until it's restarted!
  357.  
  358. When switching back to text mode (either with CTRL-ALT-Fxx or by exiting X),
  359. the X-server just pumps all sampled text mode registers back into the VGA
  360. chip, and switches to the requested console.
  361.  
  362. If you would have changed text modes AFTER having started X, something
  363. wonderfull will happen!
  364.  
  365. Example: You start X, find a neat little text mode utility called
  366. SVGATextMode on your hyper-super-user-friendly-Internet-unfriendly WWW
  367. Browser, decide to give it a try, switch to text mode, and start fooling
  368. around with it. You set up a completely new, big, nice text mode, decide to
  369. stick with it for a while, switch back to X and start your Mail program to
  370. tell all your friends what great tool you just found. You suddenly decide to
  371. swicth back to text mode... and BANZAI! the screen is a complete mess. You
  372. decide NOT to advise all your friends to use SVGATextMode! BIG mistake (of
  373. course...).
  374.  
  375. At this moment, your text mode is back to the mode it was in BEFORE you
  376. started X (e.g. back to 80x25, instead of the 100x37 SVGATextMode provided),
  377. but something's wrong. Text is writtn in the wrong place, the prompt wraps
  378. around the screen (i.e. jumps 20 chars to the left on each new line, instead
  379. of sticking to the left side), and dissapears below your monitor.
  380.  
  381. What the X-server did, is restore text mode registers from when IT started
  382. (= before SVGATextMode). This should be no real problem, where it not that
  383. the KERNEL parameters are still at 100x37, and it writes characters to the
  384. VGA memory supposing the mode is still 100x37. A nice big screwup!
  385.  
  386. This is a 'problem' with the X-server, not with SVGATextMode. If it would
  387. sample text mode registers EVREY time it switched from text mode to X, this
  388. would not happen. 
  389.  
  390. --------
  391.  
  392. A special case: Programmable clock chips:
  393.  
  394. In addition to the problem described above, there's an extra problem for
  395. owners of a VGA card with a programmable clock chip (mostly S3 cards). Some
  396. of those clock chips are WRITE-ONLY! That means there is NO WAY to re-read
  397. the programmed clock values from the chip. This is a major problem for the
  398. X-server, because it CANNOT know what clock to restore when switching back
  399. to text mode. 
  400.  
  401. So with those chips (e.g. ICD2061a) the X-server needs to be TOLD what clock
  402. your text mode used, in order to be able to restore it properly. In XFREE
  403. 3.x, clockchips can be supported through the "ClockProg" option. And in
  404. addition to the clock frequency you needed to specify for that clockprog
  405. (first argument) there was also a SECOND argument: the clock index to use
  406. for returning to text mode.
  407.  
  408. [from XFREE 3.1 docs:]
  409.  
  410.        ClockProg "command" [textclock]
  411.  
  412.                [...]
  413.                The optional textclock value is used to tell the server that
  414.                command must be run to restore the textmode clock at server
  415.                exit (or when VT switching). textclock must match one of
  416.                the values in the Clocks entry. This parameter is required
  417.                when the clock used for text mode is a programmable clock.
  418.  
  419. For SVGATextMode, you will ALWAYS use the programmable clock (mostly the
  420. only non-programmable clocks on such chips are the VGA-standard 25 and 28
  421. MHz).
  422.  
  423. I have no idea how this works when defining a "ClockChip" in the XF86Config
  424. file. If you have a programmable clockchip card, and text modes are NOT
  425. restored properly, your first bet will be to use grabmode or clockprobe to
  426. see how the clock got programmed.
  427.  
  428. In most cases it will be back at 25 or 28 MHz, or the same clock as from X
  429. will be used. In that last case this means the X-server didn't change the
  430. clock when switching to text mode.
  431.  
  432. I don't know how to solve that, other than to advise you to use the SAME
  433. pixel clock in text mode as in X. That way when X doesn't restore the clock,
  434. and it remains where it was, it will be where it has to be (are you still
  435. following?). Theree's another advantage to this: If you pick the EXACT same
  436. timings in X as in text mode, your monitor will NOT need the extra few
  437. seconds to sync up to the new frequency. This way switching  between text
  438. modes and X is lightning fast, no delays!
  439.  
  440.  
  441. =============================================================================
  442.  
  443.  
  444.  
  445.  
  446. Various strange interactions with DOSEMU
  447. ----------------------------------------
  448.  
  449. DOSEMU, the Linux DOS emulator, can be made to run in "native" VGA mode,
  450. where it is allowed to take control of the VGA chip so you can even do VGA
  451. graphics under the DOS emulator. This is enabled when a line similar to
  452.  
  453.    video { vga  console  graphics }
  454.    
  455. is enabled in the /etc/dosemu.conf file. A chipset definition can be used
  456. for some cards to get even better support.
  457.  
  458. In order to still allow console switching, DOSEMU will "remember" the VGA
  459. registers before it allows the DOS BIOS to start changing the whole lot. 
  460.  
  461. And that's where the problems start. DOSEMU has no VGA card detection
  462. built-in, so if you use the line above, i.e. without specifying the chipset,
  463. DOSEMU will only remember the standard VGA registers. And it will only
  464. restore those when you do either a VT-switch (ALT-Fx) or exit the DOS
  465. emulator.
  466.  
  467. Let's first consider the case when you are NOT using SVGATextMode...
  468.  
  469. If your Linux console is in standard VGA text mode (80x25 or any other
  470. 80-wide text mode), then there is no problem since this IS a standard VGA
  471. mode.
  472.  
  473. BUT if you are using a "VGA" 132x25 or 132x43 mode (for example) from the
  474. lilo or loadlin config file, then you are using a 40 or 45 MHz pixel clock,
  475. and chances are that this clock is NOT one of the standard 4 first VGA
  476. clocks on your SVGA card. If you don't specify the chipset, the DOSEMU will
  477. not be able to restore this extra (SVGA) clock register, and thus chances
  478. are you return from DOSEMU with an out-of-sync screen.
  479.  
  480. If you are using SVGATextMode, things get even worse.
  481.  
  482. SVGATextMode uses all possible extended VGA clock setting registers, so you
  483. can get more exotic and better looking modes. But this comes at a price.
  484. Since DOSEMU doesn't know about so many chipsets (and in the case of S3,
  485. about all sorts of clockchips), it will NOT remember all those special
  486. registers when it starts, and it'll also not restore them when you switch
  487. away from it (or exit it).
  488.  
  489. The DOSEMU people are focussing on getting the DOS emulation as good as
  490. possible, and not on super-clean VT-restoration. That's a good thing for all
  491. of us, because this way we get a better DOSEMU faster. For as far as I know,
  492. there has been not much change in the VGA support of DOSEMU in the last
  493. year, and it doesn't look like they are going to do this quickly. With
  494. reason. I suggest you bug me enough so I could at least provide support for
  495. all SVGATextMode chipsets/clockchips in the DOSEMU code. 
  496.  
  497. Better even, if DOSEMU would use svgalib (or GGI) for its VGA save/restore
  498. code, then nobody would have to do any superfluous coding. If svgalib
  499. improves, so will DOSEMU's VGA support. Downside: you would need svgalib
  500. when using DOSEMU.
  501.  
  502. The bottom line: if you are using SVGATextMode together with DOSEMU, and you
  503. either don't let DOSEMU know what chipset you have, or DOSEMU doesn't
  504. support it, you are bound to get in trouble some day.
  505.  
  506. The solution (so far) is to either use DOSEMU in console mode (no VGA
  507. graphics), or re-run SVGATextMode each time you leave the DOS emulator, or
  508. use savetextmode/restoretextmode from svgalib.
  509.  
  510. =============================================================================
  511.  
  512.  
  513.  
  514.  
  515. Text mode clock limits are mostly LOWER than graphics mode clocks
  516. -----------------------------------------------------------------
  517.  
  518.  
  519. - The VGA chip designer at work.
  520.   - - - - - - - - - - - - - - - -
  521.  
  522. This in an often misunderstood aspect of SVGATextMode. Imagine yourself in
  523. the place of the poor dude that designed the SVGA chip you're about to fry. 
  524.  
  525. His boss wants it to be the FASTEST and CHEAPEST chip on the market. So what
  526. do you do? You look at what users really USE in a (S)VGA chip. 
  527.  
  528. Ah! They want fast Windows performance? Good, let's accelerate JUST those
  529. things that make the Windows performance increase. You've just invented the
  530. so-called "Windows accelerator".
  531.  
  532. And of course, everybody wants high resolution modes, so they can throw a
  533. zillion open windows onto the desktop without cluttering it. OK. High pixel
  534. clocks are needed here. We need to zap a LOT more pixels to the modern VGA
  535. screen than we used to do in the good old CGA-days...
  536.  
  537. Oh, and don't forget: the new buzzword is "VESA modes". Damn, we'll need
  538. high screen refresh rates. That means even higher pixel clocks. Well, let's
  539. spend some money so the GRAPHICS part is fast, 'cause that's the part that
  540. needs the high resolutions at high refresh rates (and thus the high pixel
  541. clock): a white background with a few darker parts in it (=Windows!) is MUCH
  542. more prone to screen flicker than the opposite (=most text modes).
  543. Obviously, a BLACK screen cannot flicker (except if you read Terry Pratchett
  544. novels)!
  545.  
  546. So, that's it. Most VGA chips can run AT LEAST at 85 MHz in graphics mode.
  547. If you want to spend a little more money, you'll be able to get 110 MHz, or
  548. even 135 MHz. Really expensive things can even go as high as 200 MHz. And
  549. some workstation boards can churn out pixels at an amazing 500 (five
  550. hundred!) Million 24-bit pixels per second. But you'll need to spend some
  551. more money on those. 
  552.  
  553. And text mode? Oh well, Almost nobody uses it anymore, now that windowed
  554. systems are taking over. Only some die-hard programmers consider text modes
  555. to be superior to windows stuff (for programming). Funny isn't it? Many of
  556. the people that actually MAKE those windowed environments seem to prefer
  557. text modes for programming?!
  558.  
  559. So let's make sure they can do a 132x43 screen, or even 132x60. That'll shut
  560. them up. We won't lose customers on that, since all other VGA card
  561. manufacturers do the same. There's no real money in that.
  562.  
  563.  
  564. End of story. The bottom line: graphics chip/card makers cry out loud that
  565. their thing can run at xxx MHz, and shut up about text modes. With a good
  566. reason: they're not running at that same speed as graphics modes. They
  567. didn't spend money on getting text mode performance up to speed, making the
  568. chip a cent more expensive than the other brand.
  569.  
  570. The result is that all common SVGA cards have a maximum _used_ text mode
  571. clock of just 40 or 45 MHz, since that's all that VGA card makers put in
  572. their video BIOS'ses. So why design them to be able to run at 90 MHz? Nobody
  573. will notice!
  574.  
  575. If you would be able to browse the data sheets on some cards, you'd see the
  576. difference. Most data sheets ONLY mention the maximum GRAPHICS pixel clock,
  577. and never even mention text mode maximum clock. S3 and Cirrus Logic are
  578. examples of this (don't shoot me if I overlooked it). The only positive
  579. exception is the ET4000W32i/p data book. And it says the maximum graphics
  580. clock is 86 MHz, and the max. text mode clock is (just) 56 MHz (as with many
  581. "maximum safe limits" in data books, this is highly underestimated in most
  582. cases).
  583.  
  584.  
  585. And this immediately shows my point: don't expect text mode clocks to work
  586. as high as graphics clocks! They're almost NEVER designed to do that.
  587.  
  588. But also keep in mind you might get lucky. The ET4000W32i/p for example, being
  589. the only one I know of explicitly stating a maximum text mode clock, can be
  590. used WAY beyond that maximum: although the data book says 56 is the maximum,
  591. it runs well upto even 90 MHz.
  592.  
  593. The opposite example is the Trident 8900 series: although its pixel clocks
  594. can be over 90 MHz, most cards go bananas at any speed over 45 MHz in text
  595. mode. 
  596.  
  597.  
  598. - How can you see the text mode clock is too high?  
  599.   - - - - - - - - - - - - - - - - - - - - - - - - -
  600.  
  601. Depending on how out-of-spec your text mode clock is, you'll get the
  602. following phenomena (this is a bit tough to describe. If anyone comes up
  603. with a better description, I'd like to hear about it):
  604.  
  605. - when just a tidbit too high, some characters will be "unstable". They will
  606. "crawl" on the spot. It's like they're morphing between two different
  607. characters. It's like there are two letters on the same place, switching
  608. between the one and the other at about Mach-2 :-)
  609.  
  610. In most cases, this happens on certain places only. On some cards, it's just
  611. near the left or right edge. On other cards it's only every 4 characters. On
  612. others it's only in places where LOTS of characters are closely together
  613. (like in a hexdump, or a dense text file). On my card (S3 805), this starts
  614. at about 70 MHz.
  615.  
  616. - When things get worse (clock a bit more above MAX), more and more
  617. characters will start showing that effect. Some letters will be stable, but
  618. simply the wrong letter, making it hard to read the text (it's like it's
  619. been scrambled). Sometimes it's the correct character, but shifted one pixel
  620. line down. I get this at 85-90 MHz. Not very useful.
  621.  
  622. - A bit further down the line of bad text is when text starts to show a
  623. "duplication" effect: some parts of the text are duplicated on the same line
  624. of text, more to the right. You could also witness random characters all
  625. over the screen, where none should be.
  626.  
  627. - And when things get really out of hand, it's like the monitor won't sync,
  628. the screen is a complete mess, You can not distinguish ANY characters,...
  629. Your screen looks more like an intro for a cheap science-fiction show.
  630.  
  631. The worst card of all (Trident), works perfectly up to 45 MHz, and at 50 MHz
  632. it's already in "phase 3" (the science fiction intro). That should give you
  633. an idea of what to expect.
  634.  
  635.  
  636. - "Character bandwidth"
  637.   - - - - - - - - - - - 
  638.   
  639. All the stuff above suggests there is a maximum allowable text-mode pixel
  640. clock that can be defined for each card (in most cases through
  641. experimentation, since manufacturers tend to neglect mentionning them).
  642.  
  643. That is true... to a certain extent.
  644.  
  645. The REAL speed-limiting factor in text mode is the "character bandwidth" of
  646. the VGA card, which is the speed at which the VGA card can fetch characters
  647. (and font data) from the card RAM (DRAM or VRAM). 
  648.  
  649. And that is NOT necessarily the same! As an example, compare the (peak)
  650. speed at which characters are sent out to the screen for two different text
  651. modes using the SAME pixel clock, but a DIFFERENT character width:
  652.  
  653. "v132x48"  75  1056 1096 1248 1336  768 783 784 800  font 8x16
  654. "v116x48"  75   928  976 1112 1192  768 783 784 800  font 9x16
  655.  
  656. On my S3 card, the first mode (132x48) works, but it's just a little too
  657. fast: some characters are wrong, some are shifted one pixel down, some are
  658. morphing rapidly between two or three different ones, some are missing, etc.
  659. In short: the first mode is just not good. I can't use it for real work.
  660.  
  661. The SECOND mode (116x48) uses the SAME pixel clock, and is PERFECT! Both
  662. modes use the SAME pixel clock, although the first is rubbish, and the
  663. second is OK.
  664.  
  665. The reason: the second mode is "slower" than the first. The first needs to send
  666.  
  667.     (75000000 / 8) = 9.375 MILLION   characters per second to the screen
  668.     
  669. For each character the VGA card needs to read 2 bytes of character data (1
  670. byte for the character, one for the attribute byte) PLUS one byte of font
  671. data. For each new line of the same row of characters (16 of them for a
  672. 16-pixel high font), it re-reads the character bytes, but uses a different
  673. line from the font memory (which is also in the same VGA card memory, but in
  674. a different place).
  675.  
  676. The VGA chip reads those characters 16 times (in this case) because it
  677. doesn't "remember" (or "cache") them so it won't have to re-fetch them for
  678. the next line of the same character row.
  679.  
  680. The second mode line only transfers (75000000 / 9) = 8.333 M chars per second.
  681.  
  682. So my VGA card can transfer a maximum of somewhere in between 8 and 9
  683. million characters per second to the screen, without errors.
  684.  
  685. NOTE: to avoid comments from some nitty-pitty hardware guru's: I know the
  686.       CHARACTER rate is actually 1/16th of that in this case, since
  687.       characters are 16 pixels high. But the VGA chip needs to READ those
  688.       characters at the rate mentionned above.
  689.       
  690.  
  691. The point of all this meaningless babbling is the following: The actual
  692. maximum clock speed of the text modes is not only determined by the actual
  693. pixel clock, but also by the number of pixels a character occupies: in 8-bit
  694. wide mode, you have to access a new character every 8 clock beats, while in
  695. 9-pixel wide mode, the VGA card is given one extra clock period to fetch the
  696. next character.
  697.  
  698. SO if you have a mode with 8-pixel wide chars at 75 MHz that doesn't work
  699. completely, chances are that switching to a 9-bit wide mode might do the
  700. trick (you get a little less characters per line in that case, of course).
  701.  
  702. OR: if 65 MHz is your card's maximum speed with 8-bit chars, then (65 * 9/8
  703. = 73) 73 MHz is the maximum speed with 9-bit chars.
  704.  
  705. Confusing, isn't it?
  706.  
  707.  
  708.  
  709. =============================================================================
  710.  
  711.  
  712.  
  713. What to do when SVGATextMode produces a Completely Blank Screen
  714. ---------------------------------------------------------------
  715.  
  716. There are 738 possible reasons for this. I'll just cover a few of them ...
  717.  
  718. - First of all, when the screen goes blank, although you think all settings
  719. are correct, and it SHOULD work, it's time for some debugging! Use grabmode
  720. to see if all parameters are correctly set. DO that either blindly, or
  721. create a script that contains several pairs of SVGATextMode / grabmode, and
  722. redirect all the output to a file:
  723.  
  724.     #!/bin/sh
  725.     # 
  726.     # This script sets some SVGATextMode modes automatically, and performs a
  727.     # grabmode immediately after that. This is used to check the correct
  728.     # workings of SVGATextMode, even when the screen is blank or unreadable
  729.     #
  730.     # The ouput is put the the file "STM_test_output" in the currect
  731.     # directory. Once the script is done (listen to the beep!), restore the
  732.     # screen (using "textmode" or an SVGATextMode mode that works), and
  733.     # check the output file!
  734.     #
  735.     
  736.     SVGATextMode -r -f 80x25x9 >>STM_test_output 2>&1
  737.     grabmode >>STM_test_output
  738.  
  739.     SVGATextMode -r -f 132x43x8 >>STM_test_output 2>&1
  740.     grabmode >>STM_test_output
  741.  
  742.     SVGATextMode -r -f 100x37_VGA >>STM_test_output 2>&1
  743.     grabmode >>STM_test_output
  744.  
  745.     SVGATextMode -r -f 100x37 >>STM_test_output 2>&1
  746.     grabmode >>STM_test_output
  747.  
  748.     SVGATextMode -r -f 50x15_VGA >>STM_test_output 2>&1
  749.     grabmode >>STM_test_output
  750.  
  751.     SVGATextMode -r -f v132x70 >>STM_test_output 2>&1
  752.     grabmode >>STM_test_output
  753.  
  754.     SVGATextMode -r -f 160x60x9 >>STM_test_output 2>&1
  755.     grabmode >>STM_test_output
  756.  
  757.     SVGATextMode -r -f 132x43_16 >>STM_test_output 2>&1
  758.     grabmode >>STM_test_output
  759.  
  760.     SVGATextMode -r -f 80x25x8 >>STM_test_output 2>&1
  761.     grabmode >>STM_test_output
  762.     
  763.     echo -e '\a'
  764.  
  765.     
  766.   
  767. Check the output of this script, and if all the modes that were possible
  768. (some will be rejected because of your monitor's limits, some will be
  769. rejected because the correct clock could not be found) compare favourably,
  770. then probably SVGATextMode did a good job (probably!).
  771.  
  772. - If some perfectly valid modes don't show a useful screen (blank, shifted
  773. too much to the left/right/top/bottom, "folded over" on either left or right
  774. side, ...), the it's time to use vgaset and move the screen around a bit to
  775. see if your monitor likes it better.
  776.  
  777. - also don't forget to try another monitor (as described in the "general
  778. advice" section), before blaming SVGATextMode or your video card. Monitors
  779. are often "overlooked" when it comes to video problems (especially when
  780. trying a new program)
  781.  
  782.  
  783. =============================================================================
  784.  
  785.  
  786. Screen seems to sync up, but completely unreadable
  787. --------------------------------------------------
  788.  
  789. It could happen that, after runnng SVGATextMode, your screen looks like it
  790. syncs up (it's stable, it's not scrolling like crazy, grabmode reports the
  791. mode is OK, ...), but you cannot read a thing. It's like all characters are
  792. blocks, the font is completely messed up.
  793.  
  794. I don't know the reason for this (yet), but some cards seem to get their
  795. font messed up sporadically when switching modes (I have seen this on Cirrus
  796. cards). I suspect this is either something I didn't do that I should do when
  797. switching modes, or a VGA card problem. 
  798.  
  799. The simplest solution in that case is to enable automatic font loading. When
  800. switching modes, and the font gets messed up, the font loader will of course
  801. load a new font, effectively solving (well, actually 'circumventing') the
  802. problem.
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.